﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="ManagerUserAccount.aspx.cs" Inherits="Admin_UserAccountManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <p>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </p>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Label ID="Label7" runat="server" Text="Search By Account"></asp:Label>
            <asp:TextBox ID="txtSearchUserAccount" runat="server" Width="259px"></asp:TextBox>
            <asp:Label ID="Label3" runat="server" Text="Search Field"></asp:Label>
            <asp:DropDownList ID="ddlUserAccount" runat="server">
                <asp:ListItem Value="_name">FullName</asp:ListItem>
                <asp:ListItem Value="_userName">UserName</asp:ListItem>
                <asp:ListItem Value="_email">Email</asp:ListItem>
                <asp:ListItem Value="_adress">Adress</asp:ListItem>
            </asp:DropDownList>
            <asp:Button ID="btnSearchUserAccount" runat="server" OnClick="btnSearchUserAccount_Click" Text="Search" />
            <asp:Button ID="btnShowAllUserAccount" runat="server" OnClick="btnShowAllUserAccount_Click" Text="Show All" />
            <asp:GridView ID="gdvUserAccount" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id_UA" ForeColor="#333333" GridLines="None" OnPageIndexChanging="gdvSearchByUserAccount_PageIndexChanging" OnRowCancelingEdit="gdvUserAccount_RowCancelingEdit" OnRowCommand="gdvUserAccount_RowCommand" OnRowDeleting="gdvUserAccount_RowDeleting" OnRowEditing="gdvSearchByUserAccount_RowEditing" OnRowUpdating="gdvUserAccount_RowUpdating" PageSize="5" ShowHeaderWhenEmpty="True" Width="829px">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="userName" HeaderText="UserName" ReadOnly="True" />
                    <asp:BoundField DataField="name" HeaderText="Full Name" />
                    <asp:BoundField DataField="dateOfBirth" HeaderText="BirthDay" />
                    <asp:TemplateField HeaderText="Sex">
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddlEditSex" runat="server" SelectedIndex='<%# Convert.ToInt32(Eval("sex")) %>'>
                                <asp:ListItem Selected="True" Value="0">Female</asp:ListItem>
                                <asp:ListItem Value="1">Male</asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Convert.ToInt32(Eval("sex"))==1?"Male" : "Female" %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="email" HeaderText="Email" />
                    <asp:BoundField DataField="adress" HeaderText="Adress" />
                    <asp:TemplateField HeaderText="Edit">
                        <EditItemTemplate>
                            <asp:ImageButton ID="ibnSave" runat="server" CommandName="update" Height="19px" ImageUrl="~/Admin/Images/icon_Save.png" ToolTip="Click here to update this account" Width="19px" />
                            <asp:ImageButton ID="ibtnCancel" runat="server" CommandName="cancel" Height="19px" ImageUrl="~/Admin/Images/icon_Undo.png" ToolTip="Click here to cancel edit" Width="19px" />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:ImageButton ID="ibtnEdit" runat="server" CommandName="edit" ImageUrl="~/Admin/Images/icon_Edit.png" ToolTip="Click here to edit this acount" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:ImageButton ID="ibtnDeleteUserAccount" runat="server" CommandName="delete" Height="17px" ImageUrl="~/Admin/Images/icon_Delete.png" OnClientClick="javascript:return confirm(&quot;Are you want to delete this User Account ? &quot;);" Width="19px" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Mobile">
                        <ItemTemplate>
                            <asp:ImageButton ID="ibtnSelectMobile" runat="server" CausesValidation="False" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" CommandName="cmdSelectMobile" Height="19px" ImageUrl="~/Admin/Images/icon_Select.png" Width="27px" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
            <br />
            <asp:GridView ID="gdvMobileNumber" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id_MN" ForeColor="#333333" GridLines="None" OnRowCancelingEdit="gdvMobileNumber_RowCancelingEdit" OnRowEditing="gdvMobileNumber_RowEditing" ShowHeaderWhenEmpty="True" Width="374px">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="Id_MN" HeaderText="ID" />
                    <asp:BoundField DataField="phone" HeaderText="Mobile Number" />
                    <asp:TemplateField HeaderText="Edit">
                        <EditItemTemplate>
                            <asp:ImageButton ID="ibnSave" runat="server" CommandName="update" Height="19px" ImageUrl="~/Admin/Images/icon_Save.png" ToolTip="Click here to update this account" Width="19px" />
                            <asp:ImageButton ID="ibtnCancel" runat="server" CommandName="cancel" Height="19px" ImageUrl="~/Admin/Images/icon_Undo.png" ToolTip="Click here to cancel edit" Width="19px" />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:ImageButton ID="ibtnEdit" runat="server" CommandName="edit" ImageUrl="~/Admin/Images/icon_Edit.png" ToolTip="Click here to edit this acount" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:ImageButton ID="ibtnDelete" runat="server" CommandName="delete" Height="18px" ImageUrl="~/Admin/Images/icon_Delete.png" OnClientClick="javascript:return confirm(&quot;Are you want to delete this Mobile Number ?&quot;)" Width="21px" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#7C6F57" />
                <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#E3EAEB" />
                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F8FAFA" />
                <SortedAscendingHeaderStyle BackColor="#246B61" />
                <SortedDescendingCellStyle BackColor="#D4DFE1" />
                <SortedDescendingHeaderStyle BackColor="#15524A" />
            </asp:GridView>
            <br />
            <br />
            <asp:Label ID="lblStatus" runat="server" ForeColor="Red" Text="Label"></asp:Label>
        </ContentTemplate>
    </asp:UpdatePanel>
    <p>
        <br />
    </p>

</asp:Content>

